{% extends "account/base.html" %}

{% load i18n %}
{% load widget_tweaks %}

{% block head_title %}{% trans "Password Reset" %}{% endblock %}

{% block content %}
<div class="container">
  <div class="row justify-content-center logreg">
      <div class="col-sm-11 col-md-8 col-lg-6">
          <div id="logreg-forms">
              <h1 class="text-center">{% trans "Password Reset" %}</h1>
              {% if user.is_authenticated %}
              {% include "account/snippets/already_logged_in.html" %}
              {% endif %}
              <div style="width: 100%; height: 20px; border-bottom: 1px solid var(--color-divider); margin-bottom: 16px;"></div>
              <form method="POST" action="{% url 'account_reset_password' %}" class="password_reset">
                  {% csrf_token %}

                  {% with WIDGET_ERROR_CLASS='field_error' WIDGET_REQUIRED_CLASS='field_required' %}
                  <div class="form-group">
                      {% render_field form.email class="form-control" aria-describedby="emailHelp" placeholder="Email address" %}
                      {% if form.email.errors %}
                      <small id="emailHelp" class="text-danger">
                          {% for error in form.email.errors %}
                          {{ error|escape }}
                          {% endfor %}
                      </small>
                      {% endif %}
                  </div>
                  {% endwith %}
                  <button type="submit" class="btn btn-primary btn-block">{% trans 'Reset My Password' %}</button>
              </form>
          </div>
      </div>
  </div>
</div>
{% endblock %}
